package Effects

import (
	. "GameLogic/Scene/Unit"
	xml "misc/dom4g"
)

type EffectLaunchMissile struct {
	EffectInfo
	AmmoUnit  string
	AmmoMover string
}

func CreateEffectLaunchMissile(node *xml.Element) IEffect {
	effect := &EffectLaunchMissile{}
	effect.EffectInfo.Parse(node)

	if moverName, ok := node.AttrValue("AmmoMover"); ok {
		effect.AmmoMover = moverName
	}
	if unitName, ok := node.AttrValue("AmmoUnit"); ok {
		effect.AmmoUnit = unitName
	}
	return effect
}

func (this *EffectLaunchMissile) Exec() {
	mover := CreateMover(this.AmmoMover)
	mover = mover
}

func (this *EffectLaunchMissile) GetBaseInfo() *EffectInfo {
	return &this.EffectInfo
}
